<template>
  <div id="cart">
    <!--导航栏-->
    <NavBar class="nav-bar">
      <div slot="center">购物车({{cartLength}})</div>
    </NavBar>
    <!--购物车列表-->
    <cart-list class="cart-list" :cart-list="cartList"></cart-list>
    <!--底部汇总-->
    <CartBottonBar></CartBottonBar>
  </div>
</template>

<style scoped>
  #cart {
    /*position: relative;*/
    height: 100vh;
  }

  .nav-bar {
    background-color: hotpink;
    color: white;
    font-weight: 700;

    position: fixed;
    left: 0;
    right: 0;
    top: 0;
    z-index: 9;
  }

  .cart-list {
    position: absolute;
    top: 44px;
    bottom: 49px;
    width: 100%;
  }
</style>

<script>
  import NavBar from 'components/navbar/NavBar'
  import { mapGetters } from 'vuex'
  import CartList from 'views/cart/childComps/CartList'
  import CartBottonBar from 'views/cart/childComps/CartBottonBar'

  export default {
    name: 'Cart',
    created() {

    },
    mounted() {

    },
    data() {
      return {

      }
    },
    computed: {
      ...mapGetters([
        'cartLength',
        'cartList',
      ])
    },
    methods: {

    },
    components: {
      NavBar,
      CartList,
      CartBottonBar,

    },
  }
</script>